home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 7 / autod101.zip / CRSADL.SLT next >
Text File  |  1991-07-09  |  4KB  |  142 lines

  1.  
  2. // AutoDownload Telix Script for CRS   ver 1.01             d/ 09 JUL 91
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. // This SALT Script file continuously redials CRS until a connection
  5. // is established. It then opens the file "FILES.DL" (which should 
  6. // contain a list of files to be downloaded), logs into the IBM conference,
  7. // and Batch Downloads the files listed using ZModem. After the download 
  8. // session (or if disconnected), the script automatically hangs up and 
  9. // exits Telix to DOS.
  10. // modified from scripts by Matthew Silver and "JOHN DORF"
  11.  
  12. str user_name[] = "YOUR NAME";            // Replace with your name.
  13. str listname[] = "FILES.DL";              // file name of list to download
  14. str fname [14];                           // filename to download
  15. int infile;                               // dllist.get file handle
  16. str number_list[] = "1 2";                // dialing dir entries to redial
  17.  
  18. main()
  19.  
  20. {
  21.  int stat;
  22.  int t1,
  23.      t2,
  24.      t3,
  25.      t4,
  26.      t5,
  27.      t6,
  28.      t7,
  29.      t8,
  30.      t9,
  31.      t10,
  32.      t11;
  33.  int tmark;
  34.  int conf_flag = 0;
  35.  
  36.  alarm(1);
  37.  
  38.  redial(number_list,0,1);                     // redial numbers til connxn
  39.  
  40.  infile = fopen(listname,"r");                // open download files list
  41.  if (infile == 0)
  42.    prints("Error opening FILES.DL!");
  43.  
  44.  t1 = track("Language # to use", 0);
  45.  t2 = track(" graphics", 0);
  46.  t3 = track("first name?", 0);
  47.  t4 = track("Password",0);
  48.  t5 = track("(H)elp, More?", 0);
  49.  t6 = track("Scan Message Base", 0);
  50.  t7 = track("Main Board Command", 0);
  51.  t8 = track("Conference Command?",0);
  52.  t9 = track("Filename to Download",0);
  53.  t10 = track("Protocol Type for Transfer",0);
  54.  t11 = track("(G)oodbye after Batch,",0);
  55.  
  56.  tmark = timer_start(1800);
  57.  
  58.  while (1)
  59.   {
  60.    terminal();
  61.  
  62.    stat = track_hit(0);
  63.  
  64.    if (stat == t1)              // "language # to use"
  65.      {
  66.      delay(1);
  67.      cputc('^M');
  68.      }
  69.    else if (stat == t2)         //"graphics"
  70.      {
  71.      cputs("N Q");
  72.      cputc('^M');
  73.      }
  74.    else  if (stat == t3)         //"first name"
  75.      {
  76.      cputs(user_name);
  77.      cputc('^M');
  78.      }
  79.    else  if (stat == t4)         //"Password"
  80.      {
  81.      cputs(_entry_pass);
  82.      cputc('^M');
  83.      }
  84.    else if (stat == t5)         //"(H)elp, More?"
  85.      {
  86.      cputs("n");
  87.      cputc('^M');
  88.      }
  89.    else if (stat == t6)         //"Scan Message Base"
  90.      {
  91.      cputs("n");
  92.      cputc('^M');
  93.      }
  94.    else if (stat == t7)         //"Main Board Command"
  95.      {
  96.      cputs("j 2");
  97.      cputc('^M');
  98.      }
  99.    else if (stat == t8)         //"Conference Command?"
  100.      {
  101.      cputs("DB");
  102.      cputc('^M');
  103.      }
  104.    else if (stat == t9)         //"filename to download"
  105.      {
  106.      if (!feof(infile))                        // process this list
  107.        {
  108.        fgets(fname,14,infile);
  109.        cputs(fname);             // enter the filename
  110.        cputs("^M");
  111.        }
  112.      else
  113.        {
  114.        fclose(infile);
  115.        }
  116.      }
  117.    else if (stat == t10)         //"Protocol Type for Transfer"
  118.      {
  119.      cputs("Z");
  120.      cputc('^M');
  121.      }
  122.    else if (stat == t11)         //"(G)oodbye after Batch,"
  123.      {
  124.      cputs("G");
  125.      cputc('^M');
  126.      timer_free(tmark);
  127.      track_free(0);
  128.      }
  129.    else if (not carrier (1))
  130.      {
  131.      hangup(0);
  132.      exittelix(0);
  133.      break;
  134.      }
  135.   }
  136.   if (time_up(1))
  137.      prints("Logon failed!");
  138.   timer_free(tmark);
  139.   track_free(0);
  140. }              
  141.  
  142.